<template>
  <el-card class="bingzhuang">
    <div ref="bz" style="height: 240px"></div>
  </el-card>
</template>

<script>
import * as echarts from 'echarts'
import { getData } from '@/api/index.js'
export default {
  mounted() {
    getData().then(({ data }) => {
      // console.log(data)
      const { videoData } = data.data
      const echartsbz = echarts.init(this.$refs.bz)
      const echartsbzOption = {
        tooltip: {
          trigger: 'item'
        },
        color: ['#0f78f4', '#dd536b', '#9462e5', '#a6a6a6', '#e1bb22', '#39c362', '#3ed1cf'],
        series: [
          {
            data: videoData,
            type: 'pie'
          }
        ]
      }
      echartsbz.setOption(echartsbzOption)
    })
  }
}
</script>

<style lang="less" scoped></style>
